7 Answers, 1 is accepted
You can do so by specifying the database type this column is mapped to. This can be done by using the HasColumnType method of the Fluent Mapping API. For example if you are using MS SQL Server you will have to input "nvarchar(MAX)" as its type.
I hope this is helpful, if you have any other questions or face further trouble please let us know.
Serge
the Telerik team
At the time being there is no straight forward way of specifying this, we will be working on support for default values for the container which is a feature that will solve this issue. However for the moment there is an easy workaround you can use.
Given the fact that the fluent mapping is generated during runtime you can easily change the string value you provide to the HasColumnType based on the current backend.
We have implemented a similar solution for a customer by defining an attribute that holds the column types for different backends, that one can place over his properties and a set of extensions methods for the Fluent Mapping API that given a backend would read this attribute and set the column type correctly . If you are interested in this solution we will be more than happy to provide it.
I hope this is helpful.
Serge
the Telerik team
PS. What I was expecting is the ORM mapper to know how to map the .NET types to DB types. If string is > 8000 for mssql it should use 'text' type for example not varchar(255). etc.
This is something to think about.
Please have a look at the project that I have attached. It should give you an idea of how you can accomplish this by customizing the Fluent Mapping trough extension methods. As I have already mentioned this implicit type calculation is not something we are looking forward however you should be able to achieve the same result by yourself.
If you have any questions or have trouble with the project make sure to let us know. I am looking forward to resolving any issues you might face.
Serge
the Telerik team
We will certainly make sure to take this into account when planning the future improvements of the Fluent Mapping API.
I would like again to thank you for your feedback and mention that while we strive to give you a working solution at the moment we are open to suggestions about the API.
Serge
the Telerik team