There is my table:
public
class
Sound
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
public
Guid GUID {
get
;
set
; }
[Display(Name =
"Sound Type"
)]
[Required]
public
SoundType SoundType {
get
;
set
; }
[Display(Name =
"Bandwidth, kHz"
)]
public
byte
? Bandwidth {
get
;
set
; }
[Display(Name=
"Frequency, Hz"
)]
public
short
? Frequency {
get
;
set
; }
[Display(Name =
"Duration, ms"
)]
public
short
? Duration {
get
;
set
; }
[Display(Name=
"Sound File"
)]
public
byte
[] Content {
get
;
set
; }
[Display(Name =
"File Name"
)]
public
string
FileName {
get
;
set
; }
public
Sound()
{
GUID = Guid.NewGuid();
}
}
I just would like to show it in a grid and to be possible to upload files into the Content field and to store their names in the FileName field.
I've been trying to find out some examples of how to perform this, but almost all of them use separated steps to upload files into some directory on the server and to save the path to the file in the table then. I prefer to save the file attributes and its content as one step using Create or Update method of .
Is it possible to do it this way? Are there some examples?
Thank you.