Пример #1
0
        public async Task <ActionResult <IEnumerable <string> > > CreateBuddy([FromBody] BuddyApiModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            await _buddiesRepo.CreateUser(new BuddyModel(model));

            return(Ok());
        }
Пример #2
0
 public BuddyModel(BuddyApiModel model)
 {
     FirstName    = model.FirstName;
     LastName     = model.LastName;
     Long         = model.Long;
     Lat          = model.Lat;
     Location     = model.Location;
     MobileNumber = model.MobileNumber;
     Id           = Guid.NewGuid().ToString();
     Profile      = model.Profile;
     Rating       = model.Rating;
     ImageUrl     = model.ImageUrl;
 }