Beispiel #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)));
     }
 }
Beispiel #2
0
        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);
        }