简体   繁体   English

OpenAccess ORM-WithCascadeDelete不可用

[英]OpenAccess ORM - WithCascadeDelete Not Available

I am using ORM version 2013.2.702.1 and ASP.NET MVC 4.5. 我正在使用ORM版本2013.2.702.1和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: 我试图像文档一样使用WithCascadeDelete: 类级别的Cascade Delete ,但是该方法不可用:

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? 知道为什么吗?

Currently, OpenAccess ORM has a Q3 2013 Beta version that includes the Cascade Delete feature. 当前,OpenAccess ORM具有2013年第三季度Beta版本,其中包括层叠删除功能。 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 . 让我补充一下,“级联删除”功能仅适用于利用“垂直继承”和“ 多表实体”的模型

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM