public void InsertFluorography(int id, Fluorography fluorography) { var entity = context.GeneralInformation.FirstOrDefault(t => t.Id == id); if (entity == null) { throw new NullReferenceException(); } fluorography.Id = 0; entity.Fluorographies.Add(fluorography); context.SaveChanges(); }
public static FluorographyView EntityToView(this Fluorography entity) { if (entity != null) { return(new FluorographyView { Id = entity.Id, ProcedureTime = entity.ProcedureTime, Information = entity.Information }); } return(null); }