35 lines
674 B
C#
35 lines
674 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace FileService.Domain.ValueObjects
|
|
{
|
|
public class FileName
|
|
{
|
|
public string Value { get; }
|
|
|
|
public FileName(string value)
|
|
{
|
|
if(value.Length > 20)
|
|
{
|
|
throw new ArgumentException("文件名超出长度");
|
|
}
|
|
|
|
Value = value;
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return Value;
|
|
}
|
|
|
|
public static implicit operator FileName(string value)
|
|
{
|
|
return new FileName(value);
|
|
}
|
|
|
|
}
|
|
}
|