moh-hassan/odata2poco

Nullable Microsoft.OData.Edm.Date

LarsBauer opened this issue · 5 comments

Hi,

is there are specific reason why nullable Microsoft.OData.Edm.Date is not implemented?
If I understand your source correctly this should just be a small change in OData2PocoLib/Helper.cs

        /// <summary>
        /// Nullable DataType
        /// </summary>
        public static readonly Dictionary<string, string> NullableDataTypes = new Dictionary<string, string>
      {
            {"object" , ""},
            {"string" , ""},
            {"bool" , "?"},
            {"byte" , "?"},
            {"char" , "?"},
            {"decimal" , "?"},
            {"double" , "?"},
            {"short" , "?"},
            {"int" , "?"},
            {"long" , "?"},
            {"sbyte" , "?"},
            {"float" , "?"},
            {"ushort" , "?"},
            {"uint" , "?"},
            {"ulong" , "?"},
            {"void" , "?"},
            ////Nullable DateTime issue #3 , included in v2.3.0
            {"DateTime","?" },
            {"DateTimeOffset","?" },
            {"TimeSpan","?" },
            {"Guid","?" },
            // THIS IS NEW
            {"Microsoft.OData.Edm.Date","?"},
            {"Microsoft.OData.Edm.TimeOfDay","?"}
        };

Can I provide a pull request for this feature?
Thanks in advance!

Thanks for suggestion.
You can provide PR and nice to add also Microsoft.OData.Edm.DateTimeOffset

Thanks for the quick response.
I just opened the PR. The type Microsoft.OData.Edm.DateTimeOffset does not exist. I think it gets resolved to regular DateTimeOffset.

Ok, thanks

Hey, any plans to merge my PR?

Hi @LarsBauer
PR is merged and a new package v3.4.2 is available.