hytos / ID2.Manager / ID2.Manager.Data / Models / AttFileInfo.cs @ 295ce375
이력 | 보기 | 이력해설 | 다운로드 (2.15 KB)
1 |
using System; |
---|---|
2 |
using System.Collections.Generic; |
3 |
using System.Linq; |
4 |
using System.Text; |
5 |
using System.Threading.Tasks; |
6 |
|
7 |
using System.Runtime.Serialization; |
8 |
using System.ComponentModel; |
9 |
using System.ComponentModel.DataAnnotations.Schema; |
10 |
|
11 |
namespace ID2.Manager.Data.Models |
12 |
{ |
13 |
[DataContract] |
14 |
public class AttFileInfo : IEquatable<AttFileInfo> |
15 |
{ |
16 |
private string fileID; |
17 |
|
18 |
[DataMember] |
19 |
public string FileID { get => fileID; |
20 |
set => fileID = value; } |
21 |
[DataMember] |
22 |
public string RefID { get; set; } |
23 |
[DataMember] |
24 |
public string Category { get; set; } |
25 |
[DataMember] |
26 |
public string FileType { get; set; } |
27 |
[DataMember] |
28 |
public string FileName { get; set; } |
29 |
[DataMember] |
30 |
public string FilePath { get; set; } |
31 |
[DataMember] |
32 |
public string FileExtension { get; set; } |
33 |
[DataMember] |
34 |
public byte[] FileData { get; set; } |
35 |
[DataMember] |
36 |
public string Remark { get; set; } |
37 |
[DataMember] |
38 |
public DateTime CreatedDate { get; set; } |
39 |
[DataMember] |
40 |
public string Creator { get; set; } |
41 |
|
42 |
public bool Equals(AttFileInfo other) |
43 |
{ |
44 |
return other != null |
45 |
&& FileID == other.FileID |
46 |
&& RefID == other.RefID |
47 |
&& Category == other.Category |
48 |
&& FileType == other.FileType |
49 |
&& FilePath == other.FilePath |
50 |
&& FileName == other.FileName |
51 |
&& FileExtension == other.FileExtension |
52 |
&& CreatedDate == other.CreatedDate |
53 |
&& Creator == other.Creator |
54 |
&& FileData != null && other.FileData != null && FileData.SequenceEqual(other.FileData); |
55 |
} |
56 |
|
57 |
public override int GetHashCode() |
58 |
{ |
59 |
return this.FileID.GetNullableHash() + this.RefID.GetNullableHash() + this.Category.GetNullableHash() + this.FileType.GetNullableHash() |
60 |
+ FilePath.GetNullableHash() + FileName.GetNullableHash() + FileExtension.GetNullableHash() + FileData.GetNullableHash() + CreatedDate.GetNullableHash() + Creator.GetNullableHash(); |
61 |
} |
62 |
|
63 |
} |
64 |
} |