Very simple trivial implementaions of 'not implemented' interfaces.

I understand that the change is partial - that is what our MS implementation depends upon, which we are trying to port onto Mono.

Thanks,
Dmitriy
Hello,

I can confirm that by using this MS class in our code. It uses ResourceType.GetPrimitiveResourceType(Type), where type is a primitive value type. Something like this:

                    Type t = attr.GetAttributeType();
                    switch (attr.TypeCode)
                    {
                        //set of OData primitives (http://www.odata.org/documentation/overview#AbstractTypeSystem)
                        case TypeCode.Boolean:
                        case TypeCode.Byte:
                        case TypeCode.DateTime:
                        case TypeCode.Decimal:
                        case TypeCode.Double:
                        case TypeCode.Single:
                        case TypeCode.Int16:
                        case TypeCode.Int32:
                        case TypeCode.Int64:
                        case TypeCode.SByte:
                        case TypeCode.String:
                            //set the Key flag if this attr is an index
                            ResourcePropertyKind propertyKind = attr.IsIndex ? ResourcePropertyKind.Primitive | ResourcePropertyKind.Key : ResourcePropertyKind.Primitive;
                            resourceProperty = new ResourceProperty(validatedAttrName, propertyKind, ResourceType.GetPrimitiveResourceType(t));

Thanks,
Dmitiry

From: Alexander Köplinger [mailto:notifications@github.com]
Sent: Friday, August 01, 2014 3:09 PM
To: mono/mono
Cc: Dmitriy Shvidchenko
Subject: Re: [mono] Very simple trivial implementaions of 'not implemented' interfaces. (#1186)


In mcs/class/System.Data.Services/System.Data.Services.Providers/ResourceType.cs:

> @@ -118,10 +118,6 @@ public ResourceType (Type instanceType, ResourceTypeKind resourceTypeKind, Resou

>                              throw new ArgumentNullException ("instanceType");

>                      if (String.IsNullOrEmpty (name))

>                              throw new ArgumentNullException ("name");

> -                    if (resourceTypeKind == ResourceTypeKind.Primitive)

> -                            throw new ArgumentException ("'Primitive' is not a valid value for resourceTypeKind", "resourceTypeKind");

> -                    if (instanceType.IsValueType)

> -                            throw new ArgumentException ("Clr type for the resource type cannot be a value type.");

Why are these checks removed? Can you confirm .NET doesn't do the checks?

—
Reply to this email directly or view it on GitHub<https://github.com/mono/mono/pull/1186/files#r15713434>.