public ActionResult AddExhibitorToClass(AddExhibitorToClass addExhibitorToClass) { string actionBy = User.Identity.Name; _mainResponse = _exhibitorService.AddExhibitorToClass(addExhibitorToClass, actionBy); _jsonString = Mapper.Convert <BaseResponse>(_mainResponse); return(new OkObjectResult(_jsonString)); }
public MainResponse AddExhibitorToClass(AddExhibitorToClass addExhibitorToClass, string actionBy) { var exhibitor = new ExhibitorClass { ExhibitorId = addExhibitorToClass.ExhibitorId, ClassId = addExhibitorToClass.ClassId, HorseId = addExhibitorToClass.HorseId, Date = addExhibitorToClass.Date, CreatedBy = actionBy, CreatedDate = DateTime.Now }; _exhibitorClassRepository.Add(exhibitor); _mainResponse.Message = Constants.CLASS_EXHIBITOR; _mainResponse.Success = true; return(_mainResponse); }