Beispiel #1
0
        public static async Task Main(string[] args)
        {
            var isRelease = args.Length > 0 && args[0].IsEqualTo("-release");

            Setup.Bootstrap(isRelease ? SetupType.Release : SetupType.Debug);

            _repository = IocWrapper.Instance.GetService <ICatRepository>();

            await _repository.Create(new Cat("Widget", Ability.Eating));

            await _repository.Create(new Cat("Garfield", Ability.Engineering));

            await _repository.Create(new Cat("Mr. Boots", Ability.Napping));
        }
Beispiel #2
0
 public Cat CreateCat(Cat cat)
 {
     return(_catRepo.Create(cat));
 }
        public async Task <IActionResult> Post([FromBody] Cat entity)
        {
            await _repository.Create(entity);

            return(Ok());
        }