예제 #1
0
        public PersonVM GetByUsername(string username)
        {
            var context = new Model.hackathon_shift_2016_testEntities();

            var viewModel = PersonMapper.Map(context.Person.Single(person => person.Username == username));

            context.Dispose();

            return(viewModel);
        }
예제 #2
0
        public PersonVM Get(int id)
        {
            if (id == 0)
            {
                id = 14; //14 is currently logged in user
            }
            var context   = new Model.hackathon_shift_2016_testEntities();
            var viewModel = PersonMapper.Map(context.Person.Single(person => person.Id == id));

            context.Dispose();

            return(viewModel);
        }