来自物化的System.String'的指定演员表。输入' System.Guid'类型无效

时间:2018-01-03 22:40:11

标签: c# linq

这是我的......

public class Clinician
{
    public Guid ClinicianId { get; set; }

    [Required, MaxLength(255), Unique(1)]
    public string FirstName { get; set; }
    [Required, MaxLength(255), Unique(1)]
    public string LastName { get; set; }
}

public partial class user_mstr
{
    public Guid ldap_guid { get; set; }

    [StringLength(18)]
    public string last_name { get; set; }

    [StringLength(13)]
    public string first_name { get; set; }
 }

调用接口

IEnumerable<Clinician> ICliniciansRepository.GetAll(Guid? locationId)
{

    return (from um in context.user_mstr
            join pm in context.provider_mstr on um.provider_id equals pm.provider_id
            join upx in context.user_provider_xref on um.provider_id equals upx.provider_id
            join upr in context.user_provider_relationship on upx.relationship_id equals upr.relationship_id
            orderby um.first_name, um.last_name
            select new Clinician
            {   
                ClinicianId = um.ldap_guid,
                FirstName = um.first_name,
                LastName = um.last_name 
             }).ToArray();

}

临床医师Id和um.ldap_guid属于GUID类型。我哪里错了?

0 个答案:

没有答案