public OperationResult <IUserDTO> CreateUser(IUserDTO userDTO) { IUserBDC userBDC = (IUserBDC)BDCFactory.Instance.Create(BDCType.UserBDC); return(userBDC.CreateUser(userDTO)); //throw new NotImplementedException(); }
public HttpResponseMessage Post([FromBody] UserAPIModel user) { try { if (ModelState.IsValid) { if (userBDC.CreateUser(mapper.Map <UserDTO>(user))) { return(Request.CreateResponse(HttpStatusCode.OK, true)); } else { return(Request.CreateResponse(HttpStatusCode.BadRequest, Resources.AlreadyRegisteredUser)); } } else { return(Request.CreateResponse(HttpStatusCode.BadRequest, ModelState)); } } catch (Exception ex) { return(Request.CreateResponse(HttpStatusCode.InternalServerError, false)); } }
public IHttpActionResult Post(UserDTO item) { IUserBDC userBDC = (IUserBDC)BDCFactory.Instance.Create(BDCType.UserBDC); IUserDTO userDTO = (IUserDTO)DTOFactory.Instance.Create(DTOType.UserDTO); userDTO.UserID = item.UserID; userDTO.UserName = item.UserName; userDTO.AccountBalance = item.AccountBalance; userDTO.BlockedAmount = item.BlockedAmount; userDTO.Contact = item.Contact; userDTO.DOB = item.DOB; userDTO.Email = item.Email; userDTO.UniqueUserId = item.UniqueUserId; userDTO.image = item.image; OperationResult <IUserDTO> val = userBDC.CreateUser(userDTO); if (val.IsValid()) { return(Ok(val.Data)); } return(NotFound()); }
public OperationResult <IUserDTO> CreateUser(IUserDTO UserDTO) { IUserBDC UserBDC = (IUserBDC)BDCFactory.Instance.Create(BDCType.UserBDC); return(UserBDC.CreateUser(UserDTO)); }