What ASP.Net Dynamic Data support does?
- Automatically renders fully functional editable pages that are dynamically constructed from your ORM data model ('Linq to Sql' or 'Linq to Entity') meta-data.
- Provides automatic UI validation support based on the constraints set on your data model classes from the database, if not modified by you. These data constraints can be modified by extending a model class (implementing its partial class). No need to put validation checks in aspx code.
renames column UnitsInStock and defines range for it.
[MetadataType(typeof(Product_MD))]
public partial class Product{
partial void OnProductNameChanging(string value){
if (value[0] == 'a') throw new Exception("Must not start with a");
}}
[DisplayName("My units")]
[Description("This number shows how many unites are left")] [Range(0, 150, ErrorMessage = "Incorrect range for the units in stock")]
public object UnitsInStock { get; set; }}
- Provides support for modifying field/page templates and also integrating third party templates (both field and page level) very easily.
[MetadataType(typeof(CategoryMetadata))]
public partial class Category
{
}
public class CategoryMetadata {
[UIHint("DbImage")]
public object Picture { get; set; }
}
Here Scott Hunter's talks about adding image support using DD field templates support.
- Watch this Video presented at MIX 08 for detailed introduction of Dynamic Data Support Feature.
- Also David Ebbo's blog mentions changes between Dynamic Data December Preview and April Preview.
No comments:
Post a Comment