internal void Seed() { var myEntities = new MyEntity[] { new MyEntity() { Name = "MyEntity 1" }, new MyEntity() { Name = "MyEntity 2" }, new MyEntity() { Name = "MyEntity 3" } }; foreach (var myEntity in myEntities) { _myService.Create(myEntity.Name); } _output.WriteLine($"{myEntities.Length} entities have been created."); }
public IActionResult Create([FromBody] MyEntity myEntity) { return(new ObjectResult(_myService.Create(myEntity.Name))); }