Example #1
0
        private static void UpdatePerson(PeopleRepostiory repostiory)
        {
            //You alwaiys have access to DbContext
            var context = (ApplicationDbContext)repostiory.AppContext;
            var last    = context.People.First();
            var id      = last.Id;

            var viewModel = new UpdateViewModel
            {
                Id   = id,
                Name = "Updated data for entity"
            };

            var operationResult = repostiory.Update(viewModel);

            if (operationResult.Ok)
            {
                Console.WriteLine("Updated successfully");
            }
        }