Hi,

can you please provide a VB .NET sample for localization with DataObjects.NET? I tried to convert C# sample in the manual, but I found it difficult; can't translate this part

[Field] // This is a storage of all localizations for Page class public LocalizationSet<pagelocalization> Localizations { get; private set; }

because in VB there aren't auto-implemented properties

http://msdn.microsoft.com/en-us/library/dd293589(v=vs.120).aspx

so I don't know:

  • how to correctly manage the Get part of the property; I have to write it explicitly
  • how to initialize correctly LocalizationSet(of T); I don't know which parameters to use in Public Sub New(owner As Xtensive.Orm.Entity, field As Xtensive.Orm.Model.FieldInfo); I think that owner = my entity, but what about FieldInfo?

asked Oct 31 '14 at 08:48

Tommaso%20Gobbato's gravatar image

Tommaso Gobbato
5111


2 Answers:

Hi Tommaso Gobbato.

I thing you can't do it. If we have C# interface which have property like this


interface SomeInterface
{
  String SomeTextProperty { get; }
}

then C# allows implement additional setter, but not VB.Net In VB.Net implementation of properties like this must be ReadOnly. DataObjects.Net initializes that property by itself and uses internal mechanisms for creating instanses. Even if you initialize it in constructor, Dataobjects can't reinitialize it later.

answered Nov 05 '14 at 10:25

Alexey%20Kulakov's gravatar image

Alexey Kulakov
73215

Hi Alexey,

thank you for reply; I supposed I can't do it, needed just a confirmation; it's a pity, I'm evaluating some .NET ORM products for my company, and data localization is a very important feature for our needs; so it would be it great to have it directly without too much self-coding. Do you think that it could be implemented in next versions of DataObjects.NET for VB.NET too, or the limit of the language is too difficult / impossible to bypass?

Of course a workaround can be to write entity classes in C# in a separate project and other parts of application in VB, anyway I'm going on with evaluation of the product

Other great features would be:

  • a visual designer, to design entities quicker and easier
  • T4-style code generation (as for example in Telerik DataAccess or DevArt LinqConnect), to easily generate POCO classes and converters beetween them and entities

answered Nov 06 '14 at 04:36

Tommaso%20Gobbato's gravatar image

Tommaso Gobbato
5111

Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

Subscription:

Once you sign in you will be able to subscribe for any updates here

Tags:

×4
×2

Asked: Oct 31 '14 at 08:48

Seen: 3,161 times

Last updated: Nov 06 '14 at 04:36

powered by OSQA