コード例 #1
0
 public void DeletePerson(int personId)
 {
     using (var actions = new PersonActions())
     {
         actions.DeletePerson(personId);
     }
 }
コード例 #2
0
 public int SavePerson(Contoso.Apps.Insurance.Data.DTOs.Person person)
 {
     using (var actions = new PersonActions())
     {
         var personModel = PersonMapping.MapDtoToEntity(person);
         actions.SavePerson(personModel);
         person.Id = personModel.Id;
     }
     return(person.Id);
 }
コード例 #3
0
 public int SavePerson(Data.DTOs.Person person)
 {
     using (var actions = new PersonActions(_connectionString))
     {
         var personModel = PersonMapping.MapDtoToEntity(person);
         actions.SavePerson(personModel);
         person.Id = personModel.Id;
     }
     return(person.Id);
 }
コード例 #4
0
        public IList <Contoso.Apps.Insurance.Data.DTOs.Person> GetPeopleWhoAreNotPolicyHolders()
        {
            List <Contoso.Apps.Insurance.Data.DTOs.Person> people;

            using (var actions = new PersonActions())
            {
                people = actions.GetPeopleWhoAreNotPolicyHolders().Select(PersonMapping.MapEntityToDto).ToList();
            }

            return(people);
        }
コード例 #5
0
        // GET api/people
        public IList <Data.DTOs.Person> GetAllPeople(bool getPeopleWhoAreNotPolicyHolders = false)
        {
            List <Data.DTOs.Person> people;

            using (var actions = new PersonActions(_connectionString))
            {
                people = getPeopleWhoAreNotPolicyHolders ? actions.GetPeopleWhoAreNotPolicyHolders().Select(PersonMapping.MapEntityToDto).ToList() : actions.GetAllPeople().ToList().Select(PersonMapping.MapEntityToDto).ToList();
            }

            return(people);
        }
コード例 #6
0
        public static void Main(string[] args)
        {
            // This is the result from the first task
            PrimitveType.OperationsOnBoolean();

            // This is the result from the second task
            PersonActions personActions = new PersonActions();
            personActions.MakePerson(23);
            personActions.MakePerson(32);

            // The result from the third task cannot be included
            // in this solution but the code can, so you can find
            // it in the solution explorer.
            // Important! If you have JS Lint installed the project
            // may not run due to JSLind validation errors.
            // Go to TOOLS > JS Lint Options... > uncheck
            // Cancel build on error

            // This is the result from the fourth task
            MinesGame.Engine();
        }
コード例 #7
0
        public static void Main(string[] args)
        {
            // This is the result from the first task
            PrimitveType.OperationsOnBoolean();

            // This is the result from the second task
            PersonActions personActions = new PersonActions();

            personActions.MakePerson(23);
            personActions.MakePerson(32);

            // The result from the third task cannot be included
            // in this solution but the code can, so you can find
            // it in the solution explorer.
            // Important! If you have JS Lint installed the project
            // may not run due to JSLind validation errors.
            // Go to TOOLS > JS Lint Options... > uncheck
            // Cancel build on error

            // This is the result from the fourth task
            MinesGame.Engine();
        }