Reputation: 16219
My User class is like below when I try to update record using below query it gives me exception.
public class User
{
public User();
public Guid Id { get; set; }
public virtual Language Language { get; set; }
public Guid? LanguageId { get; set; }
public virtual City City { get; set; }
public Guid? CityId { get; set; }
}
code
Guid cityId = new Guid("4B1FCCA6-3E43-44BA-8516-BC693F02E9B5");
await myClient.For<User>()
.Filter(t => t.CityId == cityId)
.Set(new { LanguageId = languageId })
.UpdateEntryAsync();
after executing above update statement i'm getting exception
Unable to convert value of type System.String to OData type [Edm.Guid Nullable=True]
myClient
is Simple Odata client
Upvotes: 0
Views: 1871
Reputation: 18580
Apparently LanguageId = languageId
is giving you this error because Guid type is different. One is .net inbuild and one I think you are getting from your service call. Also, I think languageId
here is string which is causing the problem
As defined here http://www.odata.org/documentation/odata-version-2-0/overview/
Edm.Guid : Represents a 16-byte (128-bit) unique identifier value.
Upvotes: 1