OpenAccess ORM - WithCascadeDelete Not Available

127 views Asked by At

I am using ORM version 2013.2.702.1 and ASP.NET MVC 4.5. I am trying to use WithCascadeDelete like the documentation: Cascade Delete on Class Level, but the method is not available:

using FluentModel.Entity;
using Telerik.OpenAccess.Metadata;
using Telerik.OpenAccess.Metadata.Fluent;

namespace FluentModel.Map
{
public class ProdutoMap
{
    public static MappingConfiguration<Produto> CreateConfiguration()
    {
        var produtoMapping = new MappingConfiguration<Produto>();

        produtoMapping.MapType(p => new
        {
            p.Id,
            p.Nome,
            p.Preco,
            p.Descricao,
            p.DataCadastro

        }).ToTable("produto");

        produtoMapping.HasProperty(p => p.Id).IsIdentity(KeyGenerator.Autoinc);
        produtoMapping.HasProperty(p => p.Nome).HasLength(60);
        produtoMapping.HasProperty(p => p.Preco).IsCurrency();
        produtoMapping.HasProperty(p => p.Descricao).HasLength(60);

        produtoMapping.HasAssociation(p => p.Categoria)
                   .WithOpposite(c => c.Produtos)
                   .HasConstraint((p, c) => p.CategoriaId == c.Id)
                   .ToColumn("Categoria_id");


        return produtoMapping;
    }
  }
}

If I try to use:

produtoMapping.MapType().WithCascadeDelete()

The compiler cannot resolve the method.

Any Idea why?

1

There are 1 answers

0
Doroteya Agayna On

Currently, OpenAccess ORM has a Q3 2013 Beta version that includes the Cascade Delete feature. You can download it from here once you log in your account.

Let me just add that the Cascade Delete feature is available only for models that utilize Verticle Inheritance and Multi-Table Entities.