I think you can do it. Just above your property in the model table, add the StringLength attribute. Like after. (Remember that you will need to enable the use of System.ComponentModel.DataAnnotations;)
[StringLength(160)] public string Title { get; set; }
Update
First of all, you cannot create an index in the nvarchar (MAX) column. You can use full-text indexing, but you cannot create an index in a column to improve query performance.
From the perspective of storage, there is no difference between nvarchar (max) and nvarchar (N) when N <4000. Data is stored in a row or on line overflow pages when they are not suitable. When you use nvarchar (max) and store more than 4000 characters (8000 bytes), SQL Server uses a different method for storing data - similar to the old TEXT data types - it is stored on LOB pages.
Performance - again, for N <4000 and (max) - there is no difference. Well, technically this affects row size estimation and may introduce some problems - you can read more about this: The best way for sortable column widths
What can affect system performance is line size. If you have queries on the SCAN table, a large row size will lead to more data pages in the table -> more io operations -> performance degradation. If so, you can try to perform vertical splitting and move the nvarchar field to another table.
source share