public IObservable<Unit> InsertSpecimen(Specimen spec) { var res = InsertSPCompleted.FilterByUserState(spec) .PipeErrors() .Select(p => p.Result) .StoreMapping(spec, Mapping) .ReplayOnlyFirst(); _svc.InsertSpecimenAsync(spec.ToServiceObject(Mapping), this.GetCreds(), spec); return res; }
public int InsertSpecimen(Specimen s, UserCredentials login) { using (var db = login.GetConnection()) using (var t = new Transaction(db)) { db.Insert(s); db.Insert(s.GetProject(login.ProjectID)); db.Insert(s.GetAgent(login)); t.Complete(); return s.CollectionSpecimenID; } }
internal static IQueryable<IdentificationUnit> Units(Specimen s, DiversityDataContext ctx) { return from iu in ctx.IdentificationUnits where iu.SpecimenID == s.SpecimenID select iu; }