Exemplo n.º 1
0
        public CompanyEntity ConvertToEntity(CompanyModel entity)
        {
            if (entity == null)
                return null;

            var model = new CompanyEntity(entity.Id)
            {
                EncryptionKey = entity.EncryptionKey,
                Name = entity.Name
            };

            return model;
        }
Exemplo n.º 2
0
        public async Task<CompanyModel> ConvertToModel(CompanyEntity entity)
        {
            if (entity == null)
                return null;

            var model = new CompanyModel(entity.Id)
            {
                EncryptionKey = entity.EncryptionKey,
                Name = entity.Name
            };

            model.Addresses = await AddressRepository.Instance.GetAddresses(entity.AddressIds);
            model.Customers = await CustomerRepository.Instance.GetCutomersByCompanyId(entity.Id);

            return model;
        }