You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var entity = await databaseContext.Table1.Where($"name = '{name}'").FirstOrDefaultAsync();
154
+
155
+
if (entity is null)
156
+
return NotFound(nameof(NotFound));
157
+
158
+
var temp = await databaseContext.Table1.RemoveAsync(entity);
159
+
160
+
return Ok(temp);
161
+
}
162
+
163
+
[HttpGet("TestQueryString")]
164
+
public async Task<IActionResult>TestQueryString()
165
+
{
166
+
167
+
var query = databaseContext.Table1;
168
+
169
+
var result = query
170
+
.Take(3)
171
+
.Skip(2)
172
+
.Where("name = 'saman'")
173
+
.OrderBy(p => p.name)
174
+
.OrderBy(p => p.is_archive)
175
+
.OrderByDescending(p => p.stream_id)
176
+
.OrderBy(p => p.creation_time)
177
+
.Select(p => new FileEntityDto()
178
+
{
179
+
Name = p.name,
180
+
Size = p.cached_file_size,
181
+
Id = p.stream_id,
182
+
Type = p.file_type
183
+
});
184
+
185
+
return Ok(new
186
+
{
187
+
Query = result.ToQueryString(),
188
+
Data = await result.ToListAsync(p => new FileEntityDto()
189
+
{
190
+
Name = p.name,
191
+
Size = p.cached_file_size,
192
+
Id = p.stream_id,
193
+
Type = p.file_type
194
+
})
195
+
});
121
196
}
197
+
198
+
}
199
+
200
+
public class FileEntityDto
201
+
{
202
+
public Guid Id { get;set; }
203
+
public string? Name { get;set; }
204
+
public string? Type { get;set; }
205
+
public long Size { get;set; }
122
206
}
123
207
}
124
208
```
209
+
125
210
# Conclusion
126
211
127
212
In this article, we delved into creating a file management application using ASP.NET Core and SQL Server FileTable. This application provides functionalities fororganizing and managing filesin a web environment. Leveraging modern technologies and tools like FileTable, we were able to build a secure, reliable, and high-performance application.
128
213
214
+
215
+
# Support
216
+
If you are having problems, please let me know by [raising a new issue](https://github.com/samanazadi1996/Sam.FileTableSqlServer/issues).
217
+
218
+
# License
219
+
This project is licensed with the [MIT license](https://github.com/samanazadi1996/Sam.FileTableSqlServer?tab=MIT-1-ov-file#readme).
0 commit comments