Sorry. Not familiar with Nhibernate, as in hands on experience.
On Thu, Jan 10, 2013 at 1:16 PM, Aman Sharma <kajubadam25...@gmail.com>wrote: > This is what I have done already. I want something like Fluent Nhibernate > mapping. Like this... > > public class MyClassMapping : ClassMap<MyClass> > { > public ReportConditionMapping() > { > Map(m => m.Abc, "ABC"); > Map(m => m.Xyz, "XYZ"); > } > } > > but I dont know how to implemet this. Above implementation I took from > Nhibernate mapping. Do you know how can we implement this on POCO? > > On Fri, Jan 11, 2013 at 12:27 AM, Stephen Russell > <srussell...@gmail.com>wrote: > >> >> >> On Thu, Jan 10, 2013 at 12:49 PM, Aman Sharma >> <kajubadam25...@gmail.com>wrote: >> >>> Actually I am looking for the best design for this so that Engine could >>> be extended for different export also say export to excel. >>> >>> What I am doing is... >>> >>> For each response, I have created POCO class which is decorated with >>> Attribute Class. >>> By Applying Strategy Pattern, I am deciding whether to go for Export to >>> CSV aur Export to Excel. I am passing POCO class as a list object on it so >>> that data could be streamed as per Engine requirement. >>> >>> Now I think adding attributes on POCO class will not be a good idea. >>> So I am looking for something like mapping of properties like Fluent >>> NHibernate. Like >>> public class MyClassMapping : ClassMap<MyClass> >>> { >>> public ReportConditionMapping() >>> { >>> Map(m => m.Abc, "ABC"); >>> Map(m => m.Xyz, "XYZ"); >>> } >>> } >>> >>> With attributes I did something like this >>> >>> public class Student >>> { >>> >>> //Mapping >>> [CsvColumnName(Name = "Full Name", Order = 1)] >>> public string Name { get; set; } >>> >>> [CsvColumnName(Name = "Age", Order = 2)] >>> public int Age { get; set; } >>> } >>> >>> >>> Is it possible to have mapping like FluentNhibernate style?? >>> >> -------------------- >> >> I use this: >> >> using System.Runtime.Serialization; >> >> >> [DataContract(Name = "oUser", Namespace = >> "http://schemas.RingContainer.com/Tools/sec/v1.0")] >> public class oUser >> { >> [DataMember(Name = "UserID", Order = 1, IsRequired = true)] >> public Int32 userID >> { >> get; >> set; >> } >> [DataMember(Name = "SamAccount", Order = 1, IsRequired = true)] >> public String samAccount >> { >> get; >> set; >> } >> >> <snip> >> >> >> Like this? >> >> >> -- >> Stephen Russell >> Sr. Analyst >> Ring Container Technology >> Oakland TN >> >> 901.246-0159 cell >> >> -- >> You received this message because you are subscribed to the Google >> Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML >> Web Services,.NET Remoting" group. >> To post to this group, send email to dotnetdevelopment@googlegroups.com >> To unsubscribe from this group, send email to >> dotnetdevelopment+unsubscr...@googlegroups.com >> For more options, visit this group at >> http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en >> or visit the group website at http://megasolutions.net >> > > -- > You received this message because you are subscribed to the Google > Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML > Web Services,.NET Remoting" group. > To post to this group, send email to dotnetdevelopment@googlegroups.com > To unsubscribe from this group, send email to > dotnetdevelopment+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en > or visit the group website at http://megasolutions.net > -- Stephen Russell Sr. Analyst Ring Container Technology Oakland TN 901.246-0159 cell -- You received this message because you are subscribed to the Google Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting" group. To post to this group, send email to dotnetdevelopment@googlegroups.com To unsubscribe from this group, send email to dotnetdevelopment+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en or visit the group website at http://megasolutions.net