I am having a problem mapping a complex type in LinqConnect for Metro. Version 4.4.383
On creating the db I get the following exception:
System.ArgumentException was unhandled by user code
HResult=-2147024809
Message=convertType
Source=Devart.Data.SQLite.Linq
StackTrace:
at Devart.Data.SQLite.Linq.SqliteDataTypeGenerator.AddMainDefinition(String dataTypeName, ServerDataTypeInfo typeInfo, Boolean isIncludeDimensions, StringBuilder sb)
at Devart.Data.Linq.BaseDataTypeGenerator.GetServerTypeName(String dataTypeName, ServerDataTypeInfo typeInfo, ServerDataTypeGenerationBehaviour behaviour)
at Devart.Data.Linq.Mapping.Fluent.ServerDataTypeConvention.Apply(IPropertyConfiguration configuration, IModelConfiguration modelConfiguration)
at Devart.Data.Linq.Mapping.Fluent.FluentMappingSource. (ModelMappingConfiguration , Type )
at Devart.Data.Linq.Mapping.Fluent.FluentMappingSource.CreateMetaDataLoader(MetaModel , Type )
at Devart.Data.Linq.Mapping.MappingSource. (Type )
at Devart.Data.Linq.Mapping.MappingSource.GetModel(Type dataContextType)
at Devart.Data.Linq.DataContext. (Object , MappingSource , Type )
at Devart.Data.Linq.DataContext..ctor(String connectionString, MappingSource mapping)
at App24.MyDataContext..ctor(String connectionString, MappingSource mapping) in c:\Users\david fowler\Documents\Visual Studio 2012\Projects\App24\App24\MyDataContext.cs:line 41
at App24.MyDataContext.Create() in c:\Users\david fowler\Documents\Visual Studio 2012\Projects\App24\App24\MyDataContext.cs:line 47
at App24.MyDataContext.<DeployAsync>d__0.MoveNext() in c:\Users\david fowler\Documents\Visual Studio 2012\Projects\App24\App24\MyDataContext.cs:line 53
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at App24.MainPage.<Button_Click>d__0.MoveNext() in c:\Users\david fowler\Documents\Visual Studio 2012\Projects\App24\App24\MainPage.xaml.cs:line 43
InnerException:
My classes:
public class Complex
{
public string Prop1 { get; set; }
}
public class Class4
{
public Guid Id { get; set; }
public Complex Complex { get; set; }
}
My mapping definition:
builder.ComplexType<Complex>().Property(c => c.Prop1).ServerDataType("String").NotNullable();
builder.Entity<Class4>().FullTableName(@"""Class4""").PrimaryKey(class4 => class4.Id);
builder.Entity<Class4>().Property(class4 => class4.Complex.Prop1).ColumnName("Prop1").ServerDataType("String").NotNullable();
LinqConnect for Metro - Complex Types
Re: LinqConnect for Metro - Complex Types
Thank you for the report on this. We have reproduced this issue. We will investigate it and inform you about the results as soon as possible.
Re: LinqConnect for Metro - Complex Types
We have fixed this issue. We will inform you when the corresponding build of LinqConnect for Metro is available for download.
As a temporary workaround, you can disable ServerDataTypeConvention (only in case, when ServerDataType is correctly specified for all entity properties of your model). For example, use this code:
As a temporary workaround, you can disable ServerDataTypeConvention (only in case, when ServerDataType is correctly specified for all entity properties of your model). For example, use this code:
Code: Select all
private static MappingSource GetMappingSource(DataProvider provider)
{
FluentMappingBuilder builder = new FluentMappingBuilder(provider);
#region Disabled conventions
builder.Conventions.Remove<ServerDataTypeConvention>();
#endregion
....
}
Re: LinqConnect for Metro - Complex Types
New build of LinqConnect for Metro 4.4.428 is available for download now!
It can be downloaded from http://www.devart.com/linqconnect/download.html (trial version) or from Registered Users' Area (for users with active subscription only)
For more information, please refer to http://forums.devart.com/viewtopic.php?f=31&t=28831.
It can be downloaded from http://www.devart.com/linqconnect/download.html (trial version) or from Registered Users' Area (for users with active subscription only)
For more information, please refer to http://forums.devart.com/viewtopic.php?f=31&t=28831.