I’m pleased to announce that we’ve just shipped our last functional enhancement release for the LightSpeed 4.0 release and it includes the last major feature addition: LightSpeed.MetaData.
Blimmy, what’s this all about then?
Over the years we’ve had consistent requests from our users that they’d like to be able to access the LightSpeed Meta Model. This gives developers the power to access the entity models, field models and other interesting stuff that we keep tucked away. Typically, keeping things tucked away is a good thing as it keeps LightSpeed easy to learn and not too intimidating for the common use cases which is why we’re implementing this in a different assembly.
With LightSpeed 4 we will be shipping a new assembly: Mindscape.LightSpeed.MetaData.dll
From this library developers can use handy extension methods to pull out information about an Entity. This means three things:
What does the API look like?
Currently the API is nice and simple. We have implemented the MetaData capabilities through Extension Methods so the first thing you’ll need to do is add a reference to Mindscape.LightSpeed.MetaData.dll and then add a using statement:
Once that’s done you’ll have an extension method on any entity:
Car car = new Car(); EntityInfo entityInfo = car.EntityInfo();
Easy as that. From the EntityInfo object you can access information such as if SoftDelete is enabled, if Versioning is enabled, if CascadeDeletes are enabled and more. The interesting thing is that you can also walk the fields off an entity and inspect their information such as type, if they’re associations, read only status etc.
What would I use this for?
It really depends on your situation if you’d find a use for this capability. For example, in LightSpeed 4 we will be shipping an EntityModelBinder for ASP.NET MVC that is built using the LightSpeed.MetaData library so that we don’t need to rely on ugly reflection. We also have developers who want to do perform generic cloning operations who would find this useful. This is why we’re excited to see what people do with LightSpeed.MetaData – the only limit is on your imagination.
Right, so how do I get my hands on this?
LightSpeed 4 Beta is available to all LightSpeed customers who have active subscriptions right now. You can download it from your store account.
If you’re waiting for LightSpeed 4 to ship before purchasing then don’t – grab a LightSpeed 3.11 license and you’ll get updated LightSpeed 4.0 release on RTM.