generate ids, automap classes without ids and schema generation
Hi,
I have wsdl, using svcutil I automatically generate all my classes and interfaces for the service I need. I would like based on those classes to generate database schema too and to automap, here what I have so far:
string connectionString = sysConfig.ConfigurationManager.ConnectionStrings["connectionString"].ConnectionString;
var config = GenerateMapping(connectionString);
var model = AutoMap.AssemblyOf<cs_timeslot>()
.Where(t => t.Namespace == "lseisml");
var sessionFactory = Fluently.Configure()
.Database(MsSqlConfiguration.MsSql2008
.ConnectionString(c => c
.Is(connectionString)))
.Mappings(m => m.AutoMappings.Add(model)).ExposeConfiguration(cfg =>
{
new SchemaExport(cfg)
.Create(false, true);
}).BuildSessionFactory();
and:
public static Configuration GenerateMapping(string connectionString)
{
var config = MsSqlConfiguration.MsSql2008
.ConnectionString(c => c.Is(connectionString))
.ConfigureProperties(new Configuration());
AutoMap.AssemblyOf<lseisml.cs_timeslot>().Configure(config);
return config;
}
The problem is my classes do not have any id, ny question is: is it possible to generate the ids and then to automap and generate the schema too? I know I am lazy :-)
The final goal is to have as automated development as possible.
thank you
cheers
Valko
Comments are currently closed for this discussion. You can start a new one.
Support Staff 2 Posted by Paul Batum on 11 Mar, 2010 06:04 AM
I'm not sure I understand what you mean by "generate the ids". These are YOUR classes - how are we supposed to generate ID properties for them? You can use automapping to generate mappings for your classes, but its your responsibility to write (or in this case, generate) the classes you want mapped.
James Gregory resolved this discussion on 24 Mar, 2010 08:57 AM.