Click here to Skip to main content
15,894,343 members

Comments by Onur ERYILMAZ (Top 33 by date)

Onur ERYILMAZ 7-Feb-18 1:35am View    
I check that and I found out that the problem is my Date properties, if I send my json like this;

{"WorkCommandNumber":"F999/1","BLPProductCode":"F999","ReceivedOrderNumber":16,"GroupNumber":1}

The object's properties perfectly setting, but when I add the Date like this;

{"WorkCommandNumber":"F999/1","BLPProductCode":"F999","ReceivedOrderNumber":16,"GroupNumber":1,"WorkCommandOpenDate":"2017-12-04T23:00:00+02:00"}

I get bad request error.

How to solve that?
Onur ERYILMAZ 4-Feb-18 10:36am View    
Thank you for reply.

As I understand, you recommend starting from scratch with using WPF or Xamarin Forms. I will consider that.

I have a few questions though.

1- You talked about domain objects and business objects. As I understand I need to seperate my objects.

For example:

EF creates an object based on my database schema like this;

public class Company
    {
        [Required]
        [Key]
        public string CompanyCode { get; set; }
        public string CompanyName { get; set; }
        public CompanyTypes CompanyType { get; set; }
        public string CompanyTaxAdministration { get; set; }
        public string CompanyTaxNumber { get; set; }
        public string CompanyWebAdress { get; set; }
        public string CompanyMailAdress { get; set; }
        public byte[] CompanyLogo { get; set; }

        public virtual ICollection<CompanyAddress> CompanyAddresses { get; set; }

        public Company()
        {
            CompanyAddresses = new HashSet<CompanyAddress>();
        }
    }


And I have an object like this:

public class Company
    {
        public string CompanyCode { get; set; }
        public string CompanyName { get; set; }
        public CompanyTypes CompanyType { get; et; }
        public string CompanyTaxAdministration { get; set; }
        public string CompanyTaxNumber { get; set; }
        public string CompanyWebAdress { get; set; }
        public string CompanyMailAdress { get; set; }
        public byte[] CompanyLogo { get; set; }

        public Company(string cCode, string cName, CompanyTypes cType, string taxAdmin, string cTaxNum, string web, string mail, byte[] logo)
        {
            CompanyCode = cCode;
            CompanyName = cName;
            CompanyType = cType;
            CompanyTaxAdministration = taxAdmin;
            CompanyTaxNumber = cTaxNum;
            CompanyWebAdress = web;
            CompanyMailAdress = mail;
            CompanyLogo = logo;
        }
    }


So, when user wants to create a new company, first I get the user inputs and put these in my Company object and then convert this object to EF object with AutoMapper then send EF object to repository to save it?
Onur ERYILMAZ 24-Jan-18 9:20am View    
Exception thrown: 'AutoMapper.AutoMapperConfigurationException' in AutoMapper.dll
Exception thrown: 'AutoMapper.AutoMapperConfigurationException' in System.ServiceModel.dll
Exception thrown: 'AutoMapper.AutoMapperConfigurationException' in System.ServiceModel.dll

I can also post my all models and modeldto's?
Onur ERYILMAZ 24-Jan-18 8:47am View    
Unfortunately this is not working either :(
Onur ERYILMAZ 24-Jan-18 7:53am View    
Thank you for your response.

Class WorkCommands is exists but I don't want to transfer this class, I only want to transfer ID, WorkCommandNumber, WorkCommandDocumentDefinition, WorkCommandDocument and FileExtension properties.