コード例 #1
0
 public ApiResult <string> Update(LabSample model)
 {
     try
     {
         this.labSampleRepository.UppdateLabSample(model);
         return(ApiResult <string> .Success(RecordConstants.Update));
     }
     catch (Exception exception)
     {
         return(ApiResult <string> .Exception(this.logger.LogException(exception)));
     }
 }
コード例 #2
0
ファイル: LabsDao.cs プロジェクト: sbalac17/LIMS
        public static async Task <LabSample> AddSample(IRequestContext context, long labId, long sampleId)
        {
            var labSample = new LabSample
            {
                LabId        = labId,
                SampleId     = sampleId,
                AssignedDate = DateTimeOffset.Now,
                Notes        = ""
            };

            context.DbContext.LabSamples.Add(labSample);
            await context.DbContext.SaveChangesAsync();

            await context.LogAsync($"Added sample ID {sampleId} to lab ID {labId}");

            return(labSample);
        }