示例#1
0
        public UserEntity ConvertToEntity(UserModel entity)
        {
            if (entity == null)
                return null;

            var model = new UserEntity(entity.Id);
            model.Email = entity.Email;
            model.Password = entity.Password;

            return model;
        }
示例#2
0
        public async Task<UserModel> ConvertToModel(UserEntity entity)
        {
            if (entity == null)
                return null;

            var model = new UserModel(entity.Id);
            model.Email = entity.Email;
            model.Password = entity.Password;

            model.Companies = await CompanyRepository.Instance.GetCompaniesByUserId(model.Id);
            model.Person = await PersonRepository.Instance.GetPerson(entity.PersonId);

            return model;
        }