-
Notifications
You must be signed in to change notification settings - Fork 1
Tpc
Create a private repo in Github for your AVE homework with a distinct folder per workout. Add your teacher username as collaborator of your github repo (fmcarvalho or lfalcao-isel).
-
Install last release of .NET SDK from https://dotnet.microsoft.com/download
-
Implement a managed version of
aula02-unmanaged-static-link
with dotnet:-
PointLib
folder - contains the equivalent toPoint.kt
in csharpPoint.cs
:- run
dotnet new classlib
- replace class
Class1.cs
by aforementionedPoint.cs
- run
dotnet build
- run
dotnet publish
- run
-
PointApp
folder - Contains the equivalent toApp.java
in csharpProgram.cs
:- run
dotnet new console
- run
dotnet run
and check the output - modify
Program.cs
to implement the same behavior ofApp.java
-
NOTICE you need a reference to
point.dll
:- copy and paste
point.dll
from publish folder ofPointLib
- Add a reference to
point.dll
in.csproj
file such as:
- copy and paste
- run
-
<ItemGroup>
<Reference Include="point">
<HintPath>point.dll</HintPath>
</Reference>
</ItemGroup>
- Check the need of
point.dll
in compile and run time ofApp
.
Create a dotnet console application that prints the names of all types and their methods names contained in RestSharp.dll
of aula03-reflection
, such as:
IAuthenticator
Authenticate
HttpBasicAuthenticator
Authenticate
GetType
ToString
Equals
GetHashCode
NtlmAuthenticator
Authenticate
GetType
...
Modify the Logger.Log
from lesson 5 to present only information of members annotated with ToLog
custom attribute.
Modify the Logger.Log
from lesson 6 to present the label
annotated in ToLog
custom attribute (if exists).
Implement a simple naïf Program.cs
that read all documents from a Collection in a Firestore database following the steps described in isel-AVE-2021-FireStore-get-started.md.
Refactor project to include a new interface that specifies the way of dealing with properties, regardless their kind. This interface must have distinct implementations depending on whether it deals with complex properties (other domain types) or primitive (and string) properties.
Write in C# the equivalent program to the IL definition of methods Foo
and gcd
of files App1.il
and App2.il
of folder aula15-il-exercises
.
Generate a new method int MyMethod(MyDynamicType other)
on MyDynamicType
of lesson 16
that multiplies the values of fields m_number
between this
and other
.
The following sample should produce the result 63 on output.
object obj = Activator.CreateInstance(dynType, new object[]{7});
object other = Activator.CreateInstance(dynType, new object[]{9});
object res2 = dynType
.GetMethod("MyMethod", new Type[]{ dynType }) // Get the MethodInfo of MyMethod
.Invoke(obj, new object[]{other}); // Invoke that MethodInfo
Console.WriteLine("new MyDynamicType(7).MyMethod(new MyDynamicType(9)) --> " + res2);
The Distinct
returns a new Sequence (still eager) without repetitions (unique elements).
For example, the execution of aula34 should print:
David
Diogo
Douglas