English 中文(简体)
本SqlPara公尺的无损指数1
原标题:Invalid index 1 for this SqlParameterCollection with Count=1

我注意到的是,Ncv报告领域没有出现提及。 以下是我收到的错误。

这里是我的领域所看的,所收的错误是用数字=1计算的SqlPara公尺的无损指数1。

public class NcvMap : SubclassMap<Ncv>
{
    public NcvMap()
    {
        HasManyToMany<Document>(x => x.Technician)
            .Cascade.All();

        HasManyToMany<Document>(x => x.Neurologist)
            .Cascade.All();

        HasManyToMany<Document>(x => x.Transcriber)
            .Cascade.All();

        References<Document>(x => x.Report).Nullable();
    }
}

public class Ncv : Report
{
    public virtual IList<Document> Technician { get; private set; }
    public virtual IList<Document> Neurologist { get; private set; }
    public virtual IList<Document> Transcriber { get; private set; }
    public virtual Document Report { get; set; }
    public virtual NcvType Type { get; set; }

    public Ncv()
    {
        this.Technician = new List<Document>();
        this.Neurologist = new List<Document>();
        this.Transcriber = new List<Document>();
    }
}

public class Report : BaseModel
{
    public virtual Patient Patient { get; set; }
    public virtual ReportStatus Status { get; set; }
    public virtual DateTime Appointment { get; set; }
    public virtual long Kareo_id { get; set; }
    public virtual IList<ReportLog> Logs { get; private set; }

    public Report() 
    {
        this.Status = ReportStatus.New;
        this.Logs = new List<ReportLog>();
    }

    public virtual void AddLog(ReportLog log)
    {
        log.Report = this;
        this.Logs.Add(log);
    }
}

public class ReportMap : ClassMap<Report>
{
    public ReportMap()
    {
        Id(x => x.Id);
        Map(x => x.CreateDate);
        Map(x => x.LastModified);
        Map(x => x.Appointment);
        Map(x => x.Status).CustomType<int>();
        Map(x => x.Kareo_id);

        HasMany<ReportLog>(x => x.Logs)
            .Cascade.All();

        References<Patient>(x => x.Patient);
    }
}
问题回答

问题在于:

public class Ncv : Report

我把我的地图编号称为“报告”一类。

public virtual Document Report { get; set; }

因此,你的财产的名称与类别相同。 它打破了创建Schema





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签