public async Task <VisitLogModel> UpdateVisitLogAsync(VisitLogModel visitlog) { var visitLogForUpdate = await visitLogRepository.GetAsync(visitlog.Id); visitLogForUpdate.ModifiedDate = DateTime.Now; visitLogForUpdate.EndTime = DateTime.Now; visitLogForUpdate.LastModifierUserId = requestIdentityProvider.UserId; await visitLogRepository.SaveChangesAsync(); return(mapper.Map <VisitLogModel>(visitLogForUpdate)); }
public async Task <VisitLogModel> InsertVisitLogAsync(VisitLogModel visitlog) { var user = await userRepository.GetUser(); visitlog.AddedDate = DateTime.Now; visitlog.TenantId = user.TenantId; visitlog.CreatorUserId = requestIdentityProvider.UserId; visitlog.LastModifierUserId = requestIdentityProvider.UserId; var newSchedule = await visitLogRepository.InsertAsync(mapper.Map <VisitLog>(visitlog)); await visitLogRepository.SaveChangesAsync(); return(mapper.Map <VisitLogModel>(newSchedule)); }