mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 04:18:16 +08:00
add examples domain_01
This commit is contained in:
21
Examples/domain_01/Entitys/Album.cs
Normal file
21
Examples/domain_01/Entitys/Album.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace domain_01.Entitys
|
||||
{
|
||||
/// <summary>
|
||||
/// 专辑
|
||||
/// </summary>
|
||||
public class Album
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public virtual ICollection<Song> Songs { get; set; }
|
||||
|
||||
public DateTime PublishTime { get; set; }
|
||||
}
|
||||
}
|
11
Examples/domain_01/Entitys/AlbumSong.cs
Normal file
11
Examples/domain_01/Entitys/AlbumSong.cs
Normal file
@ -0,0 +1,11 @@
|
||||
using FreeSql.DataAnnotations;
|
||||
using System;
|
||||
|
||||
namespace domain_01.Entitys {
|
||||
public class AlbumSong {
|
||||
|
||||
public Guid AlbumId { get; set; }
|
||||
|
||||
public Guid SongId { get; set; }
|
||||
}
|
||||
}
|
19
Examples/domain_01/Entitys/Singer.cs
Normal file
19
Examples/domain_01/Entitys/Singer.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace domain_01.Entitys
|
||||
{
|
||||
/// <summary>
|
||||
/// 歌手
|
||||
/// </summary>
|
||||
public class Singer
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public string Nickname { get; set; }
|
||||
|
||||
public DateTime RegTime { get; set; } = DateTime.Now;
|
||||
}
|
||||
}
|
25
Examples/domain_01/Entitys/Song.cs
Normal file
25
Examples/domain_01/Entitys/Song.cs
Normal file
@ -0,0 +1,25 @@
|
||||
using FreeSql.DataAnnotations;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace domain_01.Entitys {
|
||||
|
||||
/// <summary>
|
||||
/// 歌曲
|
||||
/// </summary>
|
||||
public class Song {
|
||||
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public Guid SingerId { get; set; }
|
||||
public virtual Guid Singer { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public string Url { get; set; }
|
||||
|
||||
public virtual ICollection<Album> Albums { get; set; }
|
||||
|
||||
public DateTime RegTime { get; set; } = DateTime.Now;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user