Skip to content

IndexAttribute 优化,提升代码实现可读性 #2121

@BI7PRK

Description

@BI7PRK

Feature 特性

namespace FreeSql.DataAnnotations;

[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
public class IndexAttribute : Attribute
{
     public string Fields { get; set; }
}

简要描述原因

Fields 能否由string改为string[]

   public string[] Fields { get; set; }

  public IndexAttribute(string name, params string[] fields)
  {
      this.Name = name;
      this.Fields = fields;
  }

使用场景

[Index("{tablename}_user_phone", "user_id", "phone`)]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions