Example #1
0
 public BaseResponse <YachtMerchantInformationAddOrUpdateModel> FindInfoDetailById(int id)
 {
     try
     {
         var entity = _context.YachtMerchantInformationDetails.AsNoTracking()
                      .FirstOrDefault(e => e.Deleted == false && e.Id == id);
         var viewModel = new YachtMerchantInformationAddOrUpdateModel();
         viewModel.InjectFrom(entity);
         viewModel.FileStreamFID = entity.FileStreamFid;
         viewModel.ResourceKey   = _languages.Count > 0 ?
                                   _languages.FirstOrDefault(r => r.Id == entity.LanguageFid).ResourceKey: null;
         if (viewModel.ActivatedDate.HasValue)
         {
             viewModel.ActivatedDate = viewModel.ActivatedDate.Value.Date;
         }
         return(BaseResponse <YachtMerchantInformationAddOrUpdateModel> .Success(viewModel));
     }
     catch (Exception ex)
     {
         return(BaseResponse <YachtMerchantInformationAddOrUpdateModel> .InternalServerError(message : ex.Message, fullMsg : ex.StackTrace));
     }
 }