public Lawn(Models.Lawn lawn) { Id = lawn.Id; Name = lawn.Name; Description = lawn.Description; ImageUrl = lawn.ImageUrl; Sections = lawn.Sections.Select(s => new Dtos.LawnSections.LawnSection(s)).ToList(); }
public async Task <Models.Lawn> Create(LawnForCreate newLawn) { var lawn = new Models.Lawn { Name = newLawn.Name, Description = newLawn.Description, ImageUrl = newLawn.ImageUrl, CreatedDate = DateTime.UtcNow, UpdatedDate = DateTime.UtcNow }; await _lawns.InsertOneAsync(lawn); return(lawn); }