public static Models.Horse WithSire(this Models.Horse horse, int id = 3, string name = "Sire") { var sire = Create(_context, id, name); horse.Sire = sire; horse.SireId = sire.Id; return(horse); }
public static Models.Horse WithDam(this Models.Horse horse, int id = 2, string name = "Dam") { var dam = Create(_context, id, name); horse.Dam = dam; horse.DamId = dam.Id; return(horse); }
public static Models.Horse WithColor(this Models.Horse horse) { var color = ColorFactory.Create(_context); horse.Color = color; horse.ColorId = color.Id; return(horse); }
private static Dto.Horse Map(Models.Horse horse) { return(new Dto.Horse { Id = horse.Id, Name = horse.Name, Color = horse.Color.Name, Dam = horse.Dam != null ? horse.Dam.Name : string.Empty, DamId = horse.DamId, Sire = horse.Sire != null ? horse.Sire.Name : string.Empty, SireId = horse.SireId }); }
private static Dto.Horse Map(Models.Horse horse) { return(new Dto.Horse { Id = horse.Id, Name = horse.Name, Starts = horse.RaceStarts, Win = horse.RaceWins, Place = horse.RacePlace, Show = horse.RaceShow, Earnings = horse.Earnings }); }
public static Models.Horse Create(FakeDataContext context, int id = 1, string name = "Man o' War") { _context = context; Setup(context); var horse = new Models.Horse { Id = id, Name = name }; context.Horses.Add(horse); return(horse); }
public void Update(int id, Models.Horse horse) { repository.Update(id, horse); notification.SendHorseChangedMessage(horse); }
public void Post(Models.Horse horse) { repository.Post(horse); notification.SendHorseChangedMessage(horse); }