►
From YouTube: XAF Blazor Rest API
Description
Click Here to Subscribe: http://xaf.life/35
Source Code: https://github.com/egarim/XafApiController
Websites:
https://xafmarin.com/
https://www.xafers.training/
http://xafersweekly.com/
https://www.xari.io/
Free XAF Support Hour
https://calendly.com/xari/free-xaf-support-hour
Facebook Group
http://xaf.life/4g
A
Hi
everyone
in
this
video,
what
we're
going
to
do
is
a
small
demonstration
and
not
only
a
demonstration,
we're
going
to
show
the
code
of
104
solutions.
It's
a
prototype,
but
we
got
a
lot
of
it
got
a
good
reception,
so
we
showed
this
prototype
in
one
of
the
past
meetups.
I
think
it
was
like
a
few
months
ago
and
after
that,
not
only
us
got
the
request
for
like
to
see
how
it
works,
but
also
devexpress.
A
So
here
below,
you
can
see
like
the
conversation
with
dennis,
where
he's
saying.
Okay,
like
you,
have
this
type
of
solution.
If
you
want
to
expose
your
data
as
an
api
and
one
of
the
solutions
that
he
mentioned
is
ours.
So
that's
why
we
decided
to
share
this
code.
We
will
make
it
open
source
and
we
will
explain
how
it
works,
because
it's
kind
of
simple,
but
you
need
to
know,
understand
how
asp.net
core
works.
A
So
let
me
show
you
what
we
have
here.
So
basically,
we
have
a
simple
soft
application.
Is
a
normal
soft
blazer
application?
There
is
nothing
special
on
it,
but
we
have
like
three
classes
that
we
need
to
implement
in
order
to
make
an
api
out
of
a
soft
place
or
application.
So,
let's
start
with
the
first
one,
which
is
a
service,
as
you
know,
net
core
and
blazer
in
general,
they
use
the
pattern
of
dependency
injection.
So
basically
you
can
inject
classes
in
in
your
controllers.
A
So
this
is
our
service.
Basically,
we
call
it
object
space
service
and
implement
an
interface
with
only
like
one
property
and
one
method.
So
the
property
is
an
enumerable
of
types.
So
you
can
register
the
types
that
you
want
to
expose.
It's
not
necessary
to
expose
all
the
types,
just
the
types
that
you
want
and
a
method
to
create
an
object
space.
A
A
So
that's
it
and
then
we
have
the
implementation
in
the
method
where
the
object
space
provider
just
returned
a
new
object
space.
So
after
having
this,
we
will
use
net
core
dependency
injection
to
include
this
in
our
controllers.
So
let
me
show
you
how
we
register
the
the
service.
A
Basically
we
have
it
here,
like
we
add
a
singleton,
we
register
the
interface
and
then
we
register
basically
the
the
object
space
service
and
we
pass
the
list
of
types
and
the
connection
string
that
we
want
to
to
use,
and
also
here
we
have
the
list
of
types
that
we're
registering.
So
in
this
case
we're
going
to
expose
domain
object.
To
now
that
we
have
a
register
type
in
our
dependency
service,
then
what
we
need
to
create
is
a
controller,
so
here
we
have
a
controller.
It's
called
my
test
controller.
A
I
know
that
the
name
is
not
too
intuitive,
but
we
show
it
like
this
on
the
video,
so
we
wanted
to
keep
the
name
just
for
that
now
here
we
have.
The
controller
requires
the
I
object
space
service
that
we
just
created,
so
we
inject
it
in
the
constructor
and
we
keep
it
like
in
the
field
on
the
class
and
then
it's
like
quite
simple.
You
just
have
the
get
metal
and,
as
you
can
see,
it
receives
like
only
a
few
parameters
like
the
property
list.
A
Those
are
the
names
of
the
properties
that
you
want
to
expose
in
your
json,
then
the
name
of
the
type.
So
the
name
of
the
domain
object
for
like
in
this
case
we
will
use
domain
object
tool.
That
is
the
only
type
that
we
have
in
here
and
then
the
criteria
a
string
to
create
the
criteria.
So
after
that,
basically
with
the
service
that
we
have,
we
create
an
object
space
and
then
we
check
if
the
type
is
registered.
A
So
after
that,
what
we
do
is
like.
Basically,
we
create
a
soft
data
view,
so
the
object
space,
one
of
the
methods
of
the
object
space-
is
create
data
view.
So
for
that
you
pass
the
type
the
list
of
properties
that
you
want
to
show
and
the
criteria,
and
there
is
like
an
opportunity
for
extension
here,
because
we
can
add
also
sorting
in
this
case
I
pass
null,
but
you
can
implement
that
after
you
get
a
copy
of
the
source.
A
Basically,
what
you
need
to
do
is
that
you
have
the
view
and
then,
with
the
view
you
just
put
it
in
a
list
of
objects
and
that
list
of
objects,
then
you
serialize
it
to
json
and
that
will
create
the
output
in
the
browser
or
you
can
use
postman
or
whatever
in
the
in
the
video
that
we
have
before,
like
from
the
from
the
standup.
We
use
post
postman
but
in
this
case
we're
going
to
use
like
basically
just
the
browser,
and
for
that
I
have
prepared.
I
think
I
have
it
here.
B
A
few
things
to
mention,
while
you
are
looking
for
that,
is
that
we
have
the
the
concept
of
injecting
the
the
object
space
through
the
ultraspace
service,
but
we
could
also
use
the
isaf
application
provider.
That's
a
service
that
comes
with
the
software
that
you
can
use
that
application
provider
to
take
to
get
your
application
to
create
your
own
space.
So
that
would
be
also
another
way
to.
A
Yeah,
actually,
actually
it
can
go
basically
both
ways
in
the
sense
that
it
doesn't
matter
how
you
create
the
object
space
in
general.
What
you
need
to
do
is
to
be
able
to
create
to
handle
an
object
space
inside
of
a
controller
and
that
way
that
talking
about
the
controllers
and
the
apis,
there
are
some
of
them
that
are
private
somehow,
and
for
that
we
have
this
ticket
here.
Oh,
let
me
minimize.
B
This
yeah,
it's
good
to
show
that
when
you
are
creating
your
controller,
the
standard
route
for
asp.net
core
a
web
api,
they
will
select
that
route
api
and
the
name
of
the
controller.
So
in
your
case,
it's
a
my
test
controller,
but
in
this
case
you
shouldn't
use
something
like
singing
controller
sign
out
controller
challenge,
controller
reply,
loading
controller,
because
if
you
see
here
those
routes
are
already
processed
by
the
saf
application.
So
you
should
not
do
that
because
it
will.
A
Conflict
yeah,
and
actually
this
is
kind
of
tricky.
I
mean
you
have
to
go
through
the
problem
to
know
it
because
it's
still
not
documented
somehow,
because
it's
I
mean
soft
blazer
is
kind
of
new
in
that
sense.
So,
let's
let
me
see
the
application
is
running
here.
So,
let's
login,
I
want
to
show
you
how
simple
the
application
is.
A
A
B
A
Api
my
test,
my
test,
which
is
the
controller.
Then
you
pass
the
parameters
so,
as
you
can
see,
I
tried
that
before
so
that's
why
we
have
the
urls
there
so
see
you
have
the
property
list
in
this
case
we're
going
to
show
the
oid
and
the
description,
and
then
you
have
the
type
parameter
and
for
the
type
we're
going
to
pass
domain
object
to.
So
if
we
do
this,
I
see
in
the
breakpoint,
so
it
went
into
the
controller
and
see
we
have.
A
A
So
this
is
like
a
super
easy
way
to
expose
your
application,
your
data,
so
in
the
past,
for
this
I
mean
we
used
to
use
all
data.
Remember
javier,
so
it
was
like
a
good
solution,
but
you
need
to
have
another
project,
make
sure
how
your
oem
is
working,
and
you
know
data.
There
are
like
few
things
that
are
really
really
tricky,
and
this
is
like
kind
of
really
simple
way.
So
here
we
have
basically
the
two
records
that
we
have
in
the
in
the
application
and,
let's
add
a
new
record.
A
So
this
will
be
me
jose
manuel
ojeda,
and
this
will
be
description
programmer
and
again,
hello
world
so
say
unless.
A
Yeah,
actually
exactly
so,
let's
find
a
place
to
make
this
period
format
json.
A
A
So
even
in
the
in
the
example,
we
have
this
the
jwt
authentication
attribute.
So
if
you
put
this
attribute,
it
will
execute
the
the
on
action
executing
so
in
here.
If
you
can
pass
a
header,
you
can
basically
authentication.
A
So
this
is,
I
mean
part
of
the
asp.net
core
type
of
infrastructure.
You
can
basically
validate
any
type
of
header
that
you
send,
so
you
just
create
an
action
filter
attribute
and
then
you
put
it
in
top
of
the
controller
and
after
that
voila,
like
you,
have
an
api
in
a
few
lines.
A
Basically,
the
only
thing
that
xavier
said
that
you
need
to
be
aware
is
the
reserve
names
so
we're
going
to
post
all
these
two
tickets,
also
because
it's
good
that
you
know
them
that
you
have
like
some
reserve
words
like
api
sign
in
sign
out,
and
that
happened
to
me
also.
I
I
remember
that
I
used
some
reserve
names
and
it
didn't
work,
and
I
was
thinking
what
is
happening,
because
I
try
to
make
a
more
like
comprehensive
name.
A
But
in
the
end
I
returned
to
my
test
because
we
wanted
to
keep
the
same
name
as
us
that
we
show
in
the
video
from
before.
So
that's,
basically
it
we're
going
to
put
the
link
of
the
source
in
the
description
of
the
video,
and,
if
you
have
any
doubts
like
you
can
just
send
us.
An
email
or
information
will
be
at
the
beginning
of
the
video
anyway.
A
So
any
other
thing
that
you
want
to
add
javier.
B
No,
that's
pretty
much
it.
I
think
that
this
is
a
really
neat
solution.
It's
already
inside
yourself,
laser
application,
so
there
is
no
other
products.
There
is.
No
resolution
is
right
there
with
your
regular
soft
application
and
if
you
say
just
with
one
controller,
you
are
exposing
your
orm
right
away,
any
property
any
type.
So
thank
you
guys
for
watching
and
see
you
in
the
next
video
bye.