예제 #1
0
 public YachtDetailViewModel()
 {
     Yacht           = new YachtDetailModel();
     Counter         = new YachtCounterViewModel();
     Information     = new YachtInformationViewModel();
     FileStreams     = new List <YachtFileStreamViewModel>();
     PricingPlans    = new List <YachtPricingPlanViewModel>();
     AttributeValues = new List <YachtAttributeValueViewModel>();
 }
예제 #2
0
 public BaseResponse <YachtInformationViewModel> FindById(int id)
 {
     try
     {
         var result = _context.YachtInformations.Find(id);
         if (result != null && result.Deleted == false)
         {
             var model = new YachtInformationViewModel();
             model.InjectFrom(result);
             return(BaseResponse <YachtInformationViewModel> .Success(model));
         }
         return(BaseResponse <YachtInformationViewModel> .BadRequest());
     }
     catch (Exception ex)
     {
         return(BaseResponse <YachtInformationViewModel> .InternalServerError(message : ex.Message, fullMsg : ex.StackTrace));
     }
 }